NUMBERING
SRename can also add a number sequence to filenames or comments. This is
done by giving a decimal number of up to 9 digits between asterisks (*) with the TO or INSERT
actions.
If the given number contains any leading zeros these will be used on all
the numbers that will be added.
The increment value can be changed from the default 1 by giving it
immediately after the starting number separated by it by a plus (+) or
minus (-) sign.
Any other characters can be given before or after the asterisk surrounded number
and they will appear next to the number that will be added.
There are two main ways to apply numbering to filenames. You can supply
a directory with or without a file pattern and the selected filenames
will be numbered, or you can explicitly supply all the filenames that
will be numbered in the command line. Recursion is not allowed with the
second way.
When numbering is used with recursion, numbers will be placed in every
matched filename in every directory that is entered. The number will be
reset to the starting value for every directory.
Note that it won't be possible to renumber the filenames that will be
produced after the numbering process because they won't share a common
basename. To renumber the selected filenames the existing numbers will
have to be deleted and then numbering should be applied again.
Examples:
> SRename anydir NS *001* AP
output:
"testpic" renamed as "testpic001"
"sample.iff" renamed as "sample.iff002"
"readme.txt" renamed as "readme.txt003"
"datafile" renamed as "datafile004"
"preview.png" renamed as "preview.png005"
> SRename anydir PR AD TO file*20+2*
output:
"testpic" renamed as "file20.testpic"
"sample.iff" renamed as "file22.sample.iff"
"readme.txt" renamed as "file24.readme.txt"
"datafile" renamed as "file26.datafile"
"preview.png" renamed as "file28.preview.png"
> SRename testpic sample.iff readme.txt datafile preview.png NS
{*50*} AP
output:
"testpic" renamed as "testpic{50}"
"sample.iff" renamed as "sample.iff{51}"
"readme.txt" renamed as "readme.txt{52}"
"datafile" renamed as "datafile{53}"
"preview.png" renamed as "preview.png{54}"
|